package itheima.controller;

import itheima.pojo.User;
import itheima.services.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class UserController {
    @Autowired
    private UserServices userServices;

    @RequestMapping("users")
       public String toUsers(Model model){
List<User> list=userServices.queryUserList();
model.addAttribute("msg",list);
    return "users";
}
}
